@extends('home.seller.layout.index')

@section('content')
	<div class="mws-panel grid_8 mws-collapsible">
    <div class="mws-panel-header">
        <span>
            <i class="icon-table">
            </i>
            商品评论
        </span>
        <div class="mws-collapse-button mws-inset">
            <span>
            </span>
        </div>
    </div>
    <div class="mws-panel-inner-wrap">
        <div class="mws-panel-body no-padding">
            <div id="DataTables_Table_0_wrapper" class="dataTables_wrapper" role="grid">
	            <form action="/home/seller/goods/evaluate" method="get">
	            	{{ csrf_field() }}
	            	<input type="hidden" name="gid" value="{{ $gid }}">
	                <div id="DataTables_Table_0_length" class="dataTables_length">
	                    <label>
	                        显示
	                        <select size="1" name="count" aria-controls="DataTables_Table_0">
	                            <option value="5" @if(!empty($request['count']) && $request['count'] == 5 ) selected @endif>
	                                5
	                            </option>
	                            <option value="10" @if(!empty($request['count']) && $request['count'] == 10 ) selected @endif>
	                                10
	                            </option>
	                            <option value="15" @if(!empty($request['count']) && $request['count'] == 15 ) selected @endif>
	                                15
	                            </option>
	                            <option value="20" @if(!empty($request['count']) && $request['count'] == 20 ) selected @endif>
	                                20
	                            </option>
	                        </select>
	                        条
	                    </label>
	                </div>
	                <div class="dataTables_filter" id="DataTables_Table_0_filter">
	                    <label>
	                        关键字:
	                        <input type="text" aria-controls="DataTables_Table_0" name="search" value="{{ $request['search'] or '' }}" placeholder="评论内容">
	                    </label>
	                    <button type="submit" class="btn btn-default"> 搜索 </button>
	                </div>
                </form>
                <table class="mws-table mws-datatable dataTable" id="DataTables_Table_0"
                aria-describedby="DataTables_Table_0_info">
                    <thead>
                        <tr role="row">
                            <th class="sorting_asc" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-sort="ascending" aria-label="Rendering engine: activate to sort column descending" style="width: 150px;">
                                评论者
                            </th>
                            <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending" style="width: 100px;">
                                评论时间
                            </th>
                            <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Platform(s): activate to sort column ascending" style="width: 200px;">
                                评论内容
                            </th>
                            <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending" style="width: 40px;">
                                评论评分
                            </th>
                            <th class="sorting_disabled" role="columnheader" rowspan="1" colspan="1" aria-label="" style="width: 64px;">
                            	操作
                            </th>
                        </tr>
                    </thead>
                    <tbody role="alert" aria-live="polite" aria-relevant="all">
                    @foreach($data as $k => $v)
                        <tr class="odd">
                            <td class=" sorting_1">
                                {{ $v['writer'] }}
                            </td>
                            <td class="">
                                {{ date('Y-m-d H:i:s',$v['ctime']) }}
                            </td>
                            <td class="">
                                {{ $v['content'] }}
                            </td>
                            <td class="">
                            	{{ $v['score'] }}
                            </td>
                            <td class="" style="text-align:center">
                                <a href="/home/seller/goods/evaldetail?id={{ $v['id'] }}" class="btn btn-small" title="查看回帖">
                                    <i class="icon-search"></i>
                                </a>　
                                <a href="javascript:;" class="btn btn-small" title="回复评论" id="evalute_eval" info="{{ $v['id'] }}">
                                	<i class="icon-feather"></i>
                                </a>
                            </td>
                        </tr>
                        @endforeach
                    </tbody>
                </table>

                <div class="dataTables_info" id="DataTables_Table_0_info">
                    总共{{ $num }}条
                </div>
                <div id="page_page">
                	{!! $data -> appends($request) -> render() !!}
                </div>
            </div>
        </div>
    </div>
</div>
<link type="text/css" rel="stylesheet"  href="/homeassets/detail/css/basePatch.css"/>
<link type="text/css" rel="stylesheet"  href="/homeassets/detail/css/common.css" source="widget"/>
<link type="text/css" rel="stylesheet"  href="/homeassets/detail/css/myjd.easebuy.css" source="combo"/>
<div class="thickdiv" id="" style="width: 100%; height: 1181px;display:none"></div>
<div class="thickbox" id="" style="left: 289.5px; width: 762px; height: 542px;display:none">
    <div class="thickwrap" style="width: 760px;">
        <div class="thicktitle" id="" style="width:740px">
            <span>回复评论</span>
        </div>
        <div class="thickcon" id="" style="width: 740px; height: 490px; padding-left: 10px; padding-right: 10px;">
            <div id="addressDiagDiv">
                <div class="m" id="edit-cont">
                    <div class="mc">
                        <form method="post" action="/home/seller/goods/inserteval">
                            {{ csrf_field() }}
                            <div class="form">
                                <div class="item">
                                <input type="hidden" name="id" value="" id="eval_hide">
                                    <span class="" style="float:left">回复内容：</span>
                                    <div class="fl" style="clear:both;margin:10px 5px 5px 5px">
                                        <textarea name="content" id="eval_content" cols="105" rows="15"></textarea>
                                    </div>
                                </div>
                                <div class="btns" style="float:right;margin-right:5%">
                                    <input type="submit" value="回复" style="width:60px;height:30px;font-size:14px;color:#333;">
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
        <a href="#" class="thickclose" id="">×</a>
    </div>
</div>
@endsection
@section('script')
	<script src="/homeassets/detail/link/js/evaluate.js"></script>
@endsection